package com.example.roomtest

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.PrimaryKey

/**
 *@author : Administrator
 *@descreption :
 */
@Entity(tableName = "table_apple")
data class Apple constructor(
    @PrimaryKey(autoGenerate = true)
     var id: Int = 0,
    @ColumnInfo(name = "age")
     var age: Int?,
    @ColumnInfo(name = "name")
     var name: String?,
    @ColumnInfo(name = "price")
    var price: Int

) {
    //次构造函数必须要直接或者间接调用主构造函数
    constructor(age: Int?, name: String?,price :Int) : this(0, age, name, price)
}